package Zuo4Ye2;

public class HourlyEmployee extends ColaEmployee {
	private int hourSalary;
	private int hour;
	
	public HourlyEmployee() {
		super();
	}

	public HourlyEmployee(String name, int month,int hourSalary,int hour) {
		super(name, month);
		this.hourSalary = hourSalary;
		this.hour = hour;
	}

	public int getHourSalary() {
		return hourSalary;
	}

	public void setHourSalary(int hourSalary) {
		this.hourSalary = hourSalary;
	}

	public int getHour() {
		return hour;
	}

	public void setHour(int hour) {
		this.hour = hour;
	}

	@Override
	public double getSalary(int month) {
		if(hour > 160) {
			return 160*hourSalary + (hour-160)*hourSalary*1.5+ super.getSalary(month);
		}
		return hourSalary*hour + super.getSalary(month);
	}
	
}
